﻿using System.Linq;
using System.Windows;
using System.Windows.Media;
using GraphSharp.Controls;
using XmlStudio.Helper;

namespace XmlStudio.Dialogs {
    /// <summary>
    /// Interaction logic for ChangeColorDialog.xaml
    /// </summary>
    public partial class ChangeColorDialog : Window {

        private VertexControl vertex;

        public SolidColorBrush FillBrush { get; private set; }

        public SolidColorBrush StrokeBrush { get; private set; }

        public ChangeColorDialog(VertexControl vertex) {
            this.vertex = vertex;
            this.FillBrush = vertex.FillBrush as SolidColorBrush;
            this.StrokeBrush = vertex.StrokeBrush as SolidColorBrush;

            InitializeComponent();
        }

        private void OKClicked(object sender, RoutedEventArgs e) {
            this.DialogResult = true;

            this.FillBrush = BackgroundColorPicker.CurrentColor;
            this.StrokeBrush = BorderColorPicker.CurrentColor;

            this.Close();
        }
    }
}